<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminPowerRouteTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_power_route', function (Blueprint $table) {
            $table->increments('pr_id');
            $table->integer('power_id')->unsigned()->comment('权限id');
            $table->integer('route_id')->unsigned()->comment('路由ID');
            $table->index(['route_id', 'power_id']);
            //$table->foreign('route_id')->references('route_id')->on('admin_route');
            //$table->foreign('power_id')->references('power_id')->on('admin_power');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_power_route');
    }
}
